//
//  StartupManager.m
//  mUBB
//
//  Created by Cosmin Stirbu on 2/24/13.
//  Copyright (c) 2013 Cosmin Stirbu. All rights reserved.
//

#import "StartupManager.h"
#import "WSManager+EntryPoints.h"
#import "ConfigurationManager.h"

@implementation StartupManager

// Singleton
+ (StartupManager *)instance
{
    static StartupManager *instance = nil;
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        instance = [[StartupManager alloc] init];
        // Do any other initialisation stuff here
    });
    return instance;
}


- (Ticket *)getEntryPointsWithDelegate:(id<EntryPointsProtocol>)delegate {
    return [[WSManager instance] getEntryPointsWithDelegate:delegate];
}

- (BOOL)isTeacherSignedIn {
    return [[ConfigurationManager instance] applicationConfigValueForKey:USER_ID] != nil;
}

- (BOOL)shouldPresentWelcomeScreen {
    return !([self isTeacherSignedIn] || [[[ConfigurationManager instance] applicationConfigValueForKey:REMEMBER_OPTION] boolValue
                                          ]);
}

@end
